home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
SHARED.DIR
/
03093_Script_OPTIMIZE
< prev
next >
Wrap
Text File
|
1996-04-01
|
3KB
|
111 lines
-- -----------------------------------------------------------
-- Handler optimizeToFrame preloads the cast members from the
-- current frame to the given frame.
on optimizeToFrame toFrame, interruptFlag
waitCursor
if interruptFlag then setAnimationInterruptable(toFrame)
unload 1, the frame
preLoad toFrame
normalCursor
end
-- -----------------------------------------------------------
-- Handler optimizeFrameToFrame preloads the cast members from
-- the given fromFrame to the given toFrame.
on optimizeFrameToFrame fromFrame, toFrame, interruptFlag
waitCursor
if interruptFlag then setAnimationInterruptable(toFrame)
unload 1, fromFrame
preLoad fromFrame, toFrame
normalCursor
end
-- ---------------------------------------------------------------
-- Handler interruptAnimation is called when the user clicked in
-- the middle of an animation that was preloaded with an interruptFlag
-- set to TRUE.
on interruptAnimation
global animationEndMarker
-- if the user clicked on a sprite with a sprite script or a cast script,
-- do the script instead of going to the end animation marker.
puppetTransition 0 -- Added by Ephraim Feb 20 96 so click kills pending transition
if (the clickOn > 0) then
set castScript = the scriptText of cast the castnum of sprite the clickOn
set spriteScript = the scriptNum of sprite the clickOn
else
set spriteScript = 0
set castScript = EMPTY
end if
if (castScript <> EMPTY) then
-- do the cast script
tell the stage to do line 2 to the number of lines in castScript - 1 of castScript
end if
if (spriteScript > 0) then
-- do the sprite script
set spriteScriptText = the scriptText of cast spriteScript
tell the stage to do line 2 to the number of lines in spriteScriptText - 1 of spriteScriptText
end if
set the mouseDownScript = EMPTY
if (spriteScript = 0) and (castScript = EMPTY) then
-- get a temp value in case the next marker is also an animation
set toMarker = animationEndMarker
-- clear the globals
set animationEndMarker = EMPTY
go toMarker
end if
end
-- ---------------------------------------------------------------
-- Handler setAnimationInterruptable sets the mouseDownScript to
-- interruptAnimation to allow the current animation to be interrupted
-- by a mouseclick.
on setAnimationInterruptable subSectionEnd
global animationEndMarker
set animationEndMarker = subSectionEnd
set the mouseDownScript = "interruptAnimation"
end
-- ---------------------------------------------------------------
-- Handler setMouseDownScriptEmpty for animations that are not
-- interrupted.
on setMouseDownScriptEmpty
set the mouseDownScript = EMPTY
end
-- ---------------------------------------------------------------
-- Handler endAnimation
on endAnimation
setMouseDownScriptEmpty
end
-- ---------------------------------------------------------------
-- Handler endAnimationPause calls endAnimation, does not
-- process the frame and stays in the frame
on endAnimationNoProcessPause
endAnimation
go the frame
end